<template>
	<view class="component">
		<view class="sign_btn" @click="navigateToFillInfo"><!-- 我要报名按钮 -->
			<image src="../../../static/images/introduce.png"></image>
			<div class="btn">
				<button class="btn1" type="primary" size="default" style="width: 80%;" @click="handleAdminAction"
					v-if="isAdmin">我要报名</button>
			</div>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'
	export default {
		name: 'introduce',
		data() {
			return {
				state: 1 //state的初始值为普通用户（1）

			};
		},
		onLoad() {
			//获取本地存值的state值
			this.state = uni.getStorageSync('state');
			// consloe.log(this.state)

		},
		computed: {
			isAdmin() {
				return this.state === 0; //根据state的值判断是否为管理员
			}
		},
		methods: {
			navigateToFillInfo() {
				uni.navigateTo({
					url: '/pages/user/fillInfo/fillInfo'
				});
			},
			handleAdminAction() {
				// 处理管理员按钮点击事件
				console.log('管理员按钮被点击');
				// 在这里修改 isAdmin 的值，来控制按钮的隐藏
				this.isAdmin = false; // 隐藏管理员按钮
			}

		}
	}
</script>

<style scoped>
	.sign_btn {
		display: flexbox;
		border: 1px solid whitesmoke;
		padding-left: 15px;
	}

	.sign_btn image {
		/* position: absolute; */
		display: flex;
		height: 1000rpx;
		width: 700rpx;
	}

	.btn {
		margin-top: -190rpx;
		position: relative;
		/* margin-top: 800rpx; */

	}
</style>